<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>YAMI4 - C++ general-purpose interface: yami::incoming_message Class Reference</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>


</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">YAMI4 - C++ general-purpose interface
   
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.5.1 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
</div>
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
  initNavTree('classyami_1_1incoming__message.html','');
</script>
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a>  </div>
  <div class="headertitle">
<div class="title">yami::incoming_message Class Reference</div>  </div>
</div>
<div class="contents">
<!-- doxytag: class="yami::incoming_message" -->
<p>Incoming message.  
 <a href="classyami_1_1incoming__message.html#details">More...</a></p>

<p><code>#include &lt;incoming_message.h&gt;</code></p>

<p><a href="classyami_1_1incoming__message-members.html">List of all members.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classyami_1_1incoming__message.html#a58e2ecb82e1a8baa9a896b5c1d3ca84f">incoming_message</a> (<a class="el" href="classyami_1_1incoming__message.html">incoming_message</a> &amp;other)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Moving constructor.  <a href="#a58e2ecb82e1a8baa9a896b5c1d3ca84f"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">const std::string &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classyami_1_1incoming__message.html#a7b9ea8296479e886b11c197b079b9703">get_source</a> () const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the source of this incoming message.  <a href="#a7b9ea8296479e886b11c197b079b9703"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a576980218749d7216472958bade458cd"></a><!-- doxytag: member="yami::incoming_message::get_object_name" ref="a576980218749d7216472958bade458cd" args="() const " -->
const std::string &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classyami_1_1incoming__message.html#a576980218749d7216472958bade458cd">get_object_name</a> () const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the destination object name. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a8768ac21b301cea7dd91981e6d0f902a"></a><!-- doxytag: member="yami::incoming_message::get_message_name" ref="a8768ac21b301cea7dd91981e6d0f902a" args="() const " -->
const std::string &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classyami_1_1incoming__message.html#a8768ac21b301cea7dd91981e6d0f902a">get_message_name</a> () const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the message name. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a055621f78f5cec22ab851dae3df85368"></a><!-- doxytag: member="yami::incoming_message::get_parameters" ref="a055621f78f5cec22ab851dae3df85368" args="() const " -->
const <a class="el" href="classyami_1_1parameters.html">parameters</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classyami_1_1incoming__message.html#a055621f78f5cec22ab851dae3df85368">get_parameters</a> () const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Provides access to the message content. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="classyami_1_1parameters.html">parameters</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classyami_1_1incoming__message.html#a3de66d94e9bc1de208d91cad4c97f09a">extract_parameters</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Extracts the message content.  <a href="#a3de66d94e9bc1de208d91cad4c97f09a"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">const std::vector&lt; char &gt; &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classyami_1_1incoming__message.html#a254be27d86a01a4b6434c678a52a446c">get_raw_content</a> () const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Provides access to the raw buffer of message content.  <a href="#a254be27d86a01a4b6434c678a52a446c"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classyami_1_1incoming__message.html#ad4aff3f03cad6248eb660dd2ef324769">reply</a> (const <a class="el" href="classyami_1_1serializable.html">serializable</a> &amp;body=<a class="el" href="classyami_1_1parameters.html">parameters</a>(), std::size_t priority=0)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Sends back the reply.  <a href="#ad4aff3f03cad6248eb660dd2ef324769"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classyami_1_1incoming__message.html#aa9eb72b7b622fe71d5852fe635df4c31">reject</a> (const std::string &amp;reason=std::string(), std::size_t priority=0)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Sends back the rejection (exception) notification.  <a href="#aa9eb72b7b622fe71d5852fe635df4c31"></a><br/></td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock"><p>The handler allowing to inspect the details of the incoming message and sent back replies or rejection notifications.</p>
<p>The user code interacts with objects of this type mainly in the functors that are provided during object registration and that are later called back when the incoming message arrives. The handler objects can be stored aside for further processing even after the callback returns, but should not be kept alive longer than the agent itself.</p>
<p><b>Note:</b> The objects of this class are not supposed to be used from multiple threads. </p>
</div><hr/><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="a58e2ecb82e1a8baa9a896b5c1d3ca84f"></a><!-- doxytag: member="yami::incoming_message::incoming_message" ref="a58e2ecb82e1a8baa9a896b5c1d3ca84f" args="(incoming_message &amp;other)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">incoming_message::incoming_message </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classyami_1_1incoming__message.html">incoming_message</a> &amp;&#160;</td>
          <td class="paramname"><em>other</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>This class was designed to be non-copyable, but allows "destructive copy" similar to that of <code>std::auto_ptr</code>. This functionality is enough for the user to store aside the handler for further processing, but the original object is no longer valid and all attempts to use it will result in the exception. </p>

</div>
</div>
<hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="a7b9ea8296479e886b11c197b079b9703"></a><!-- doxytag: member="yami::incoming_message::get_source" ref="a7b9ea8296479e886b11c197b079b9703" args="() const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">const std::string &amp; incoming_message::get_source </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<dl class="return"><dt><b>Returns:</b></dt><dd>The name of the originating endpoint from where this incoming message has been sent. </dd></dl>

</div>
</div>
<a class="anchor" id="a3de66d94e9bc1de208d91cad4c97f09a"></a><!-- doxytag: member="yami::incoming_message::extract_parameters" ref="a3de66d94e9bc1de208d91cad4c97f09a" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classyami_1_1parameters.html">parameters</a> * incoming_message::extract_parameters </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>The message content is moved to the caller and the caller becomes the owner of the <code>parameters</code> object. This object itself is no longer holding any references to the content and therefore any future attempts to access it will result in the exception. </p>

</div>
</div>
<a class="anchor" id="a254be27d86a01a4b6434c678a52a446c"></a><!-- doxytag: member="yami::incoming_message::get_raw_content" ref="a254be27d86a01a4b6434c678a52a446c" args="() const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">const std::vector&lt; char &gt; &amp; incoming_message::get_raw_content </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Note: this function can be called only if the messages are delivered in the form of raw (not already serialized) buffers. </p>

</div>
</div>
<a class="anchor" id="ad4aff3f03cad6248eb660dd2ef324769"></a><!-- doxytag: member="yami::incoming_message::reply" ref="ad4aff3f03cad6248eb660dd2ef324769" args="(const serializable &amp;body=parameters(), std::size_t priority=0)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void incoming_message::reply </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classyami_1_1serializable.html">serializable</a> &amp;&#160;</td>
          <td class="paramname"><em>body</em> = <code><a class="el" href="classyami_1_1parameters.html">parameters</a>()</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">std::size_t&#160;</td>
          <td class="paramname"><em>priority</em> = <code>0</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Sends back the reply to the message identified by this object. The reply (or rejection) can be sent only once.</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">body</td><td>The content of the reply. </td></tr>
    <tr><td class="paramname">priority</td><td>The priority of the reply. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="aa9eb72b7b622fe71d5852fe635df4c31"></a><!-- doxytag: member="yami::incoming_message::reject" ref="aa9eb72b7b622fe71d5852fe635df4c31" args="(const std::string &amp;reason=std::string(), std::size_t priority=0)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void incoming_message::reject </td>
          <td>(</td>
          <td class="paramtype">const std::string &amp;&#160;</td>
          <td class="paramname"><em>reason</em> = <code>std::string()</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">std::size_t&#160;</td>
          <td class="paramname"><em>priority</em> = <code>0</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Sends back the rejection to the message identified by this object. The rejection (or reply) can be sent only once.</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">reason</td><td>Arbitrary text that will be visible by the message sender as a reason for rejection. </td></tr>
    <tr><td class="paramname">priority</td><td>The priority of the rejection. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
</div>
</div>
  <div id="nav-path" class="navpath">
    <ul>
      <li class="navelem"><a class="el" href="namespaceyami.html">yami</a>      </li>
      <li class="navelem"><a class="el" href="classyami_1_1incoming__message.html">incoming_message</a>      </li>

    <li class="footer">Generated on Tue Aug 6 2013 22:41:16 for YAMI4 - C++ general-purpose interface by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.5.1 </li>
   </ul>
 </div>


</body>
</html>
